home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-06-12 | 4.3 KB | 169 lines | [TEXT/Rstr] |
-
- import java.awt.TextField;
- import java.awt.TextArea;
- import java.awt.Label;
- import java.awt.Button;
-
- import java.awt.Event;
- import RectPanel;
-
- public class View extends RectPanel
- {
- RectPanel mDetailPanel;
- TextField mNameField;
- TextArea mDescriptionField;
- RectPanel mDateEntryPanel;
- Label mStartDateLabel;
- Label mEndDateLabel;
- TextField mStartDateField;
- TextField mEndDateField;
- RectPanel mTimeEntryPanel;
- Label mStartTimeLabel;
- Label mEndTimeLabel;
- TextField mStartTimeField;
- TextField mEndTimeField;
- RectPanel mNavigationPanel;
- Button mPreviousButton;
- Button mNextButton;
- Button mFirstButton;
- Button mLastButton;
-
- public View()
- {
- super();
-
- // BindingLayout b = new BindingLayout();
- // BindingLayout is a LayoutManager
- // that implements "binding" of components
- // so that they resize when they container is resized.
- // BindingLayout was written by a Roaster engineer
- // and is not publicly available.
- // If BindingLayout becomes publicly available
- // then AppMaker will generate code for it.
- // setLayout(b);
- setLayout (null);
-
- resize(300, 350);
-
- add( mDetailPanel = makeDetail());
- mDetailPanel.reshape( 10, 10, 280, 120);
- // b.setEdgeBinding (mDetailPanel, true, true, true, true);
-
- add( mDateEntryPanel = makeDateEntry());
- mDateEntryPanel.reshape( 10, 140, 280, 70);
- // b.setEdgeBinding (mDateEntryPanel, true, false, true, true);
-
- add( mTimeEntryPanel = makeTimeEntry());
- mTimeEntryPanel.reshape( 10, 220, 280, 70);
- // b.setEdgeBinding (mTimeEntryPanel, true, false, true, true);
-
- add( mNavigationPanel = makeNavigation());
- mNavigationPanel.reshape( 10, 300, 280, 40);
- // b.setEdgeBinding (mNavigationPanel, true, false, true, true);
-
- }
-
- public RectPanel makeDetail()
- {
- RectPanel panel;
-
- panel = new RectPanel();
- panel.setLayout (null);
-
- panel.resize(280, 120);
-
- panel.add (mNameField = new TextField ("Name"));
- mNameField.reshape (10, 10, 260, 20);
- // b.setEdgeBinding (mNameField, true, true, true, false);
-
- panel.add (mDescriptionField = new TextArea ("Description"));
- mDescriptionField.reshape (10, 40, 260, 70);
- // b.setEdgeBinding (mDescriptionField, true, true, true, true);
-
- return panel;
- }
-
- public RectPanel makeDateEntry()
- {
- RectPanel panel;
-
- panel = new RectPanel();
- panel.setLayout (null);
-
- panel.resize(280, 70);
-
- panel.add( mStartDateLabel = new Label("Start Date:") );
- mStartDateLabel.reshape( 10, 10, 100, 20);
-
- panel.add( mEndDateLabel = new Label("End Date:") );
- mEndDateLabel.reshape( 10, 40, 100, 20);
-
- panel.add (mStartDateField = new TextField ("Start Date"));
- mStartDateField.reshape (110, 10, 160, 20);
- // b.setEdgeBinding (mStartDateField, true, true, true, false);
-
- panel.add (mEndDateField = new TextField ("End Date"));
- mEndDateField.reshape (110, 40, 160, 20);
- // b.setEdgeBinding (mEndDateField, true, true, true, false);
-
- return panel;
- }
-
- public RectPanel makeTimeEntry()
- {
- RectPanel panel;
-
- panel = new RectPanel();
- panel.setLayout (null);
-
- panel.resize(280, 70);
-
- panel.add( mStartTimeLabel = new Label("Start Time:") );
- mStartTimeLabel.reshape( 10, 10, 100, 20);
-
- panel.add( mEndTimeLabel = new Label("End Time:") );
- mEndTimeLabel.reshape( 10, 40, 100, 20);
-
- panel.add (mStartTimeField = new TextField ("Start Time"));
- mStartTimeField.reshape (110, 10, 160, 20);
- // b.setEdgeBinding (mStartTimeField, true, true, true, false);
-
- panel.add (mEndTimeField = new TextField ("End Time"));
- mEndTimeField.reshape (110, 40, 160, 20);
- // b.setEdgeBinding (mEndTimeField, true, true, true, false);
-
- return panel;
- }
-
- public RectPanel makeNavigation()
- {
- RectPanel panel;
-
- panel = new RectPanel();
- panel.setLayout (null);
-
- panel.resize(280, 40);
-
- panel.add( mPreviousButton = new Button("Previous") );
- mPreviousButton.reshape( 10, 10, 80, 20);
-
- panel.add( mNextButton = new Button("Next") );
- mNextButton.reshape( 100, 10, 50, 20);
-
- panel.add( mFirstButton = new Button("First") );
- mFirstButton.reshape( 160, 10, 50, 20);
- // b.setEdgeBinding (mFirstButton, false, true, true, false);
-
- panel.add( mLastButton = new Button("Last") );
- mLastButton.reshape( 220, 10, 50, 20);
- // b.setEdgeBinding (mLastButton, false, true, true, false);
-
- return panel;
- }
-
- public boolean action(Event e)
- {
- return false;
- }
- }
-